﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.Data;

namespace DAL.Classes.Repository
{
    public class DataBaseFactory: IDataBaseFactory, IDisposable
    {
        protected ModelContainer context;

        public ModelContainer Create()
        {
            return context ?? (context = new ModelContainer());
        }

        public void Dispose()
        {
            if(context != null)
                context.Dispose();
        }
    }
}
